package s63.kong.shop.modules.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitConfig {
    @Bean
    public Queue queue(){
        return new Queue("kong.queue.created");
    }

    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("kong.exchange.direct");
    }

    @Bean
    public Binding binding(){
        return BindingBuilder.bind(queue()).to(directExchange()).with("kong.routing.key.add");
    }
}
